package top.doe.flink.clickhouse;

import ru.ivi.opensource.flinkclickhousesink.ClickHouseSinkConverter;

import javax.xml.crypto.Data;

public class DataBeanConverter implements ClickHouseSinkConverter<DataBean> {
    @Override
    public String convert(DataBean dataBean) {


        String builder = "(" +
                String.valueOf(dataBean.id) +
                ",'" +
                dataBean.name +
                "')";
        return builder;

    }

    // 测试用，看看转出来的字符串是否格式正确
    public static void main(String[] args) {
        DataBean cc = new DataBean(4, "cc");
        DataBeanConverter dataBeanConverter = new DataBeanConverter();
        System.out.println(dataBeanConverter.convert(cc));
    }
}
